﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.mssql
{
	// Token: 0x02000180 RID: 384
	public class TMssqlReturn : TCustomSqlStatement
	{
		// Token: 0x06000D71 RID: 3441 RVA: 0x00308B2B File Offset: 0x00306D2B
		public TMssqlReturn(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstmssqlreturn;
		}

		// Token: 0x06000D72 RID: 3442 RVA: 0x00308B3F File Offset: 0x00306D3F
		internal override void buildsql()
		{
		}

		// Token: 0x06000D73 RID: 3443 RVA: 0x00308B41 File Offset: 0x00306D41
		internal override void clear()
		{
		}

		// Token: 0x06000D74 RID: 3444 RVA: 0x00308B43 File Offset: 0x00306D43
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x06000D75 RID: 3445 RVA: 0x00308B4A File Offset: 0x00306D4A
		internal virtual void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x06000D76 RID: 3446 RVA: 0x00308B4C File Offset: 0x00306D4C
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			TReturnSqlNode treturnSqlNode = (TReturnSqlNode)this.rootNode;
			base.doParseStatement(psql);
			if (treturnSqlNode.Expr != null)
			{
				this.returnExpr = treturnSqlNode.Expr;
				this.returnExpr.doParse(this, ESqlClause.unknown);
			}
			if (treturnSqlNode.SelectSqlNode != null)
			{
				this.subquery = new TSelectSqlStatement(this.dbvendor);
				this.subquery.rootNode = treturnSqlNode.SelectSqlNode;
				this.subquery.doParseStatement(this);
			}
			return 0;
		}

		// Token: 0x17000275 RID: 629
		// (get) Token: 0x06000D77 RID: 3447 RVA: 0x00308BD0 File Offset: 0x00306DD0
		// (set) Token: 0x06000D78 RID: 3448 RVA: 0x00308BD8 File Offset: 0x00306DD8
		public virtual TExpression ReturnExpr
		{
			get
			{
				return this.returnExpr;
			}
			set
			{
				this.returnExpr = value;
			}
		}

		// Token: 0x17000276 RID: 630
		// (get) Token: 0x06000D79 RID: 3449 RVA: 0x00308BE1 File Offset: 0x00306DE1
		// (set) Token: 0x06000D7A RID: 3450 RVA: 0x00308BE9 File Offset: 0x00306DE9
		public virtual TSelectSqlStatement Subquery
		{
			get
			{
				return this.subquery;
			}
			set
			{
				this.subquery = value;
			}
		}

		// Token: 0x06000D7B RID: 3451 RVA: 0x00308BF2 File Offset: 0x00306DF2
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000D7C RID: 3452 RVA: 0x00308C02 File Offset: 0x00306E02
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.returnExpr != null)
			{
				this.returnExpr.acceptChildren(v);
			}
			if (this.subquery != null)
			{
				this.subquery.acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x0400130D RID: 4877
		private TSelectSqlStatement subquery;

		// Token: 0x0400130E RID: 4878
		private TExpression returnExpr;
	}
}
